package top.tagao.features_05_time;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.util.ArrayList;
import java.util.Date;
import java.util.concurrent.*;

/**
 * @author fu-xiao-liu
 * @Date 2022/3/20 21:43
 */
public class Time_03_Solve {
    public static void main(String[] args) throws ExecutionException, InterruptedException {

        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMdd");

        Callable<LocalDate> task = ()-> LocalDate.parse("20161218",dtf);

        ExecutorService pool = Executors.newFixedThreadPool(10);
        ArrayList<Future<LocalDate>> results = new ArrayList<>();

        for (int i = 0; i < 10; i++) {
            results.add(pool.submit(task));
        }

        for (Future<LocalDate> future : results){
            System.out.println(future.get());
        }
        pool.shutdown();
    }

}
